<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
</head>

<body>
  <script>
    const arr = [1, 2, 3];
    // const arr = new Array(1, 2, 3)
    Array.prototype.max = function () {
      // ... 展开运算符
      return Math.max(...this)
    }
    console.log(arr.max());

    Array.prototype.min = function () {
      // ... 展开运算符
      return Math.min(...this)
    }
    console.log(arr.min());


    Array.prototype.sum = function () {
      return this.reduce((prev, item) => prev + item, 0);
    }
    console.log(arr.sum())
  </script>
</body>

</html>